#pragma once

#define _CRT_SECURE_NO_WARNINGS 1


#include <iostream>
#include <assert.h>

using namespace std;


class Date
{
public:

	friend ostream& operator<<(ostream& out, const Date& d);
	friend istream& operator>>(istream& in, Date& d);

	Date(int year = 2000, int month = 1, int day = 1);
	Date(const Date& d);

	void Print() const;
	int GetMonthDay(int year, int month);
	Date GetAfterXDay(int x);

	bool operator==(const Date& d) const;
	bool operator<(const Date& d) const;
	bool operator>(const Date& d) const;
	bool operator<=(const Date& d) const;
	bool operator>=(const Date& d) const;
	bool operator!=(const Date& d) const;
	Date& operator=(const Date& d);

	Date operator+(const int day) const;
	Date& operator+=(const int day);
	Date operator-(const int day) const;
	Date& operator-=(const int day);
	int operator-(const Date& d) const;

	Date operator++(int);
	Date& operator++();
	Date operator--(int);
	Date& operator--();

private:
	int _year;
	int _month;
	int _day;
};

ostream& operator<<(ostream& out, const Date& d);
istream& operator>>(istream& in, Date& d);